/*
 * @Author: 姚潘涛
 * @Date: 2024-04-08 15:18:03
 * @LastEditors: 姚潘涛
 * @LastEditTime: 2024-10-10 15:43:59
 * @Description:
 *
 * Copyright (c) 2024 by pandaman, All Rights Reserved.
 */
#include "xict_driver/task/driver_base.h"

namespace xict_driver {
    namespace task {
        DriverBase::DriverBase()
            : driver_state_(xict_driver::utils::DriverState::DS_IDLE) { }

        void DriverBase::RegisterExceptionCallback(
            const std::function<void(const xict_driver::utils::ErrorInfo&)>&
                _cb_exception) {
            cb_exception_ = _cb_exception;
        }

        void DriverBase::UploadException(
            const xict_driver::utils::ErrorInfo& _error_info) {
            if (cb_exception_) {
                cb_exception_(_error_info);
            }
        }
    }   // namespace task
}   // namespace xict_driver
